/* 修复开关点击区域 */
.el-switch {
  margin-right: 15px;
}

.el-switch__core {
  cursor: pointer !important;
  border-color: #DCDFE6 !important;
}

.common-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: #fff;
  box-shadow: var(--shadow-base-light, 0 4px 20px rgba(0, 0, 0, 0.12));
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--border-color, #e4e4e4);
  border-radius: 8px;
  /* 新增圆角属性 */
  margin: 8px 12px;
  /* 添加外边距避免贴边 */
}

/* 暗黑模式适配 */
.dark-mode .common-header {
  background: var(--bg-color, #363638);
  border-color: var(--border-color, #444446);
  box-shadow: 0 4px 30px rgba(255, 255, 255, 0.5);
  border: #a0a0a7
}

.header-title {
  margin: 0;
  font-size: 1.2em;
  color: #717175;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.header-title:hover {
  font-size: 1.4em;
}

/* 在.user-info中添加切换按钮 */
.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  /* 新增向左扩展间距 */
  margin-left: auto;
}

/* 新增夜间模式切换按钮样式 */
.theme-toggle {
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.theme-toggle:hover {
  background: rgba(0, 0, 0, 0.05);
}

/* 暗黑模式适配 */
.dark-mode .header-title,
.dark-mode .username {
  color: #ffffff;
}

.dark-mode .common-header {
  background: #717175;
  border-color: #a0a0a7;
}


.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #007AFF;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
}

.username {
  font-size: 0.95em;
  color: #1d1d1f;
  font-weight: 500;
}

/* 调整图标颜色 */
.theme-toggle i {
  color: #606266;
  font-size: 16px;
}

.dark-mode .theme-toggle i {
  color: #ffffff;
}

.avatar-container {
  position: relative;
  display: inline-block;
}

.avatar-container:hover .avatar-menu {
  display: block;
}

.avatar-menu {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  background: white;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  z-index: 100;
  min-width: 120px;
  transition: all 0.3s ease;
}

.menu-item {
  padding: 8px 16px;
  cursor: pointer;
}

.menu-item:hover {
  background: #f5f5f5;
}

.fade-enter-active, .fade-leave-active {
  transition: opacity 0.3s;
}
.fade-enter, .fade-leave-to {
  opacity: 0;
}
/* 调整开关样式 */
.theme-toggle {
  margin-right: 15px;
}

.el-switch__core {
  border-color: #DCDFE6 !important;
}

.dark-mode .el-switch__label {
  color: #ffffff !important;
}

/* 调整badge位置 */
.avatar-container >>> .el-badge__content {
  top: 0;
  right: 0;
  transform: translate(30%, -30%);
}

/* 暗黑模式菜单适配 */
.dark-mode .avatar-menu {
  background: #363638;
  border-color: #444446;
}

.dark-mode .menu-item {
  color: #ffffff;
}

.dark-mode .menu-item:hover {
  background: #444446;
}